
import { Injectable } from '@angular/core';
import { ViewModel, NgCommand } from '@farris/devkit';
import { Observable } from 'rxjs';

@Injectable()
export class DataGridComponentViewmodel extends ViewModel {
    public bindingPath = '/';
    // farrisDataGrid列集合定义 在对应component中赋值
    public dataGridColumns:any;
    // datGrid 列集合名称 用以bindData使用
    public dataGridColumnsName:string;

    public dom = {
  "dataGrid": {
    "type": "DataGrid",
    "resourceId": "dataGrid",
    "visible": {
      "useQuote": false,
      "isExpression": false,
      "value": true
    },
    "id": "dataGrid",
    "size": {},
    "readonly": {
      "useQuote": false,
      "isExpression": false,
      "value": false
    },
    "fields": [
      {
        "type": "GridField",
        "resourceId": "employeeID_EmployeeID_Name_9cda177f_p4x3",
        "visible": {
          "useQuote": false,
          "isExpression": false,
          "value": true
        },
        "id": "employeeID_EmployeeID_Name_9cda177f_p4x3",
        "size": {
          "width": 120
        },
        "readonly": {
          "useQuote": false,
          "isExpression": false,
          "value": false
        },
        "binding": {
          "type": "Form",
          "path": "employeeID_EmployeeID_Name",
          "isExpression": false,
          "value": "employeeID_EmployeeID_Name"
        },
        "dataField": "employeeID.employeeID_Name",
        "dataType": "string",
        "multiLanguage": false,
        "caption": "报销人",
        "draggable": false,
        "frozen": "none",
        "sortable": true,
        "resizeable": true,
        "aggregate": {
          "type": "none",
          "formatter": {
            "type": "none"
          }
        },
        "groupAggregate": {
          "type": "none",
          "formatter": {
            "type": "none"
          }
        },
        "linkedLabelEnabled": false,
        "formatter": {
          "type": "none"
        }
      },
      {
        "type": "GridField",
        "resourceId": "domainID_DomainID_name_33639652_uvc6",
        "visible": {
          "useQuote": false,
          "isExpression": false,
          "value": true
        },
        "id": "domainID_DomainID_name_33639652_uvc6",
        "size": {
          "width": 120
        },
        "readonly": {
          "useQuote": false,
          "isExpression": false,
          "value": false
        },
        "binding": {
          "type": "Form",
          "path": "domainID_DomainID_name",
          "isExpression": false,
          "value": "domainID_DomainID_name"
        },
        "dataField": "domainID.domainID_name",
        "dataType": "string",
        "multiLanguage": false,
        "caption": "所属部门",
        "draggable": false,
        "frozen": "none",
        "sortable": true,
        "resizeable": true,
        "aggregate": {
          "type": "none",
          "formatter": {
            "type": "none"
          }
        },
        "groupAggregate": {
          "type": "none",
          "formatter": {
            "type": "none"
          }
        },
        "linkedLabelEnabled": false,
        "formatter": {
          "type": "none"
        }
      },
      {
        "type": "GridField",
        "resourceId": "billCode_c41eab6f_u5x0",
        "visible": {
          "useQuote": false,
          "isExpression": false,
          "value": true
        },
        "id": "billCode_c41eab6f_u5x0",
        "size": {
          "width": 120
        },
        "readonly": {
          "useQuote": false,
          "isExpression": false,
          "value": false
        },
        "binding": {
          "type": "Form",
          "path": "billCode",
          "isExpression": false,
          "value": "billCode"
        },
        "dataField": "billCode",
        "dataType": "string",
        "multiLanguage": false,
        "caption": "单据编号",
        "draggable": false,
        "frozen": "none",
        "sortable": true,
        "resizeable": true,
        "aggregate": {
          "type": "none",
          "formatter": {
            "type": "none"
          }
        },
        "groupAggregate": {
          "type": "none",
          "formatter": {
            "type": "none"
          }
        },
        "linkedLabelEnabled": true,
        "updateOn": "blur",
        "formatter": {
          "type": "none"
        }
      },
      {
        "type": "GridField",
        "resourceId": "totalSum_9a3abc0f_rm2g",
        "visible": {
          "useQuote": false,
          "isExpression": false,
          "value": true
        },
        "id": "totalSum_9a3abc0f_rm2g",
        "size": {
          "width": 120
        },
        "readonly": {
          "useQuote": false,
          "isExpression": false,
          "value": false
        },
        "binding": {
          "type": "Form",
          "path": "totalSum",
          "isExpression": false,
          "value": "totalSum"
        },
        "dataField": "totalSum",
        "dataType": "number",
        "multiLanguage": false,
        "caption": "报帐金额",
        "draggable": false,
        "frozen": "none",
        "sortable": true,
        "resizeable": true,
        "aggregate": {
          "type": "sum",
          "formatter": {
            "precision": 2,
            "thousand": ",",
            "prefix": "￥",
            "suffix": "元",
            "decimal": ".",
            "type": "number"
          }
        },
        "groupAggregate": {
          "type": "none",
          "formatter": {
            "type": "none"
          }
        },
        "linkedLabelEnabled": false,
        "updateOn": "blur",
        "formatter": {
          "type": "number",
          "precision": 2,
          "thousand": ",",
          "decimal": "."
        }
      },
      {
        "type": "GridField",
        "resourceId": "billType_6c66ce5f_09ar",
        "visible": {
          "useQuote": false,
          "isExpression": false,
          "value": true
        },
        "id": "billType_6c66ce5f_09ar",
        "size": {
          "width": 120
        },
        "readonly": {
          "useQuote": false,
          "isExpression": false,
          "value": false
        },
        "binding": {
          "type": "Form",
          "path": "billType",
          "isExpression": false,
          "value": "billType"
        },
        "dataField": "billType",
        "dataType": "enum",
        "multiLanguage": false,
        "caption": "报销类型",
        "draggable": false,
        "frozen": "none",
        "sortable": true,
        "resizeable": true,
        "enumData": [
          {
            "name": "差旅费",
            "value": "CL"
          },
          {
            "name": "交通费",
            "value": "JT"
          },
          {
            "name": "手机费",
            "value": "SJ"
          }
        ],
        "aggregate": {
          "type": "none",
          "formatter": {
            "type": "none"
          }
        },
        "groupAggregate": {
          "type": "none",
          "formatter": {
            "type": "none"
          }
        },
        "linkedLabelEnabled": false,
        "updateOn": "change",
        "formatter": {
          "type": "none"
        }
      },
      {
        "type": "GridField",
        "resourceId": "billDate_ab442bbe_hn0h",
        "visible": {
          "useQuote": false,
          "isExpression": false,
          "value": true
        },
        "id": "billDate_ab442bbe_hn0h",
        "size": {
          "width": 120
        },
        "readonly": {
          "useQuote": false,
          "isExpression": false,
          "value": false
        },
        "binding": {
          "type": "Form",
          "path": "billDate",
          "isExpression": false,
          "value": "billDate"
        },
        "dataField": "billDate",
        "dataType": "datetime",
        "multiLanguage": false,
        "caption": "制单日期",
        "draggable": false,
        "frozen": "none",
        "sortable": true,
        "resizeable": true,
        "aggregate": {
          "type": "none",
          "formatter": {
            "type": "none"
          }
        },
        "groupAggregate": {
          "type": "none",
          "formatter": {
            "type": "none"
          }
        },
        "linkedLabelEnabled": false,
        "updateOn": "blur",
        "formatter": {
          "type": "date",
          "dateFormat": "yyyy-MM-dd HH:mm:ss"
        }
      },
      {
        "type": "GridField",
        "resourceId": "projectID_b93ca002_27am",
        "visible": {
          "useQuote": false,
          "isExpression": false,
          "value": true
        },
        "id": "projectID_b93ca002_27am",
        "size": {
          "width": 120
        },
        "readonly": {
          "useQuote": false,
          "isExpression": false,
          "value": false
        },
        "binding": {
          "type": "Form",
          "path": "projectID",
          "isExpression": false,
          "value": "projectID"
        },
        "dataField": "projectID",
        "dataType": "string",
        "multiLanguage": false,
        "caption": "所属项目",
        "draggable": false,
        "frozen": "none",
        "sortable": true,
        "resizeable": true,
        "aggregate": {
          "type": "none",
          "formatter": {
            "type": "none"
          }
        },
        "groupAggregate": {
          "type": "none",
          "formatter": {
            "type": "none"
          }
        },
        "linkedLabelEnabled": false,
        "updateOn": "blur",
        "formatter": {
          "type": "none"
        }
      },
      {
        "type": "GridField",
        "resourceId": "billNote_05d60079_u2js",
        "visible": {
          "useQuote": false,
          "isExpression": false,
          "value": true
        },
        "id": "billNote_05d60079_u2js",
        "size": {
          "width": 120
        },
        "readonly": {
          "useQuote": false,
          "isExpression": false,
          "value": false
        },
        "binding": {
          "type": "Form",
          "path": "billNote",
          "isExpression": false,
          "value": "billNote"
        },
        "dataField": "billNote",
        "dataType": "string",
        "multiLanguage": false,
        "caption": "报销说明",
        "draggable": false,
        "frozen": "none",
        "sortable": true,
        "resizeable": true,
        "aggregate": {
          "type": "none",
          "formatter": {
            "type": "none"
          }
        },
        "groupAggregate": {
          "type": "none",
          "formatter": {
            "type": "none"
          }
        },
        "linkedLabelEnabled": false,
        "updateOn": "blur",
        "formatter": {
          "type": "none"
        }
      },
      {
        "type": "GridField",
        "resourceId": "projectMrg_ProjectMrg_Name_2b937789_jhtg",
        "visible": {
          "useQuote": false,
          "isExpression": false,
          "value": true
        },
        "id": "projectMrg_ProjectMrg_Name_2b937789_jhtg",
        "size": {
          "width": 120
        },
        "readonly": {
          "useQuote": false,
          "isExpression": false,
          "value": false
        },
        "binding": {
          "type": "Form",
          "path": "projectMrg_ProjectMrg_Name",
          "isExpression": false,
          "value": "projectMrg_ProjectMrg_Name"
        },
        "dataField": "projectMrg.projectMrg_Name",
        "dataType": "string",
        "multiLanguage": false,
        "caption": "项目经理",
        "draggable": false,
        "frozen": "none",
        "sortable": true,
        "resizeable": true,
        "aggregate": {
          "type": "none",
          "formatter": {
            "type": "none"
          }
        },
        "groupAggregate": {
          "type": "none",
          "formatter": {
            "type": "none"
          }
        },
        "linkedLabelEnabled": false,
        "formatter": {
          "type": "none"
        }
      },
      {
        "type": "GridField",
        "resourceId": "auditStatus_9769d3ae_ioq3",
        "visible": {
          "useQuote": false,
          "isExpression": false,
          "value": true
        },
        "id": "auditStatus_9769d3ae_ioq3",
        "size": {
          "width": 120
        },
        "readonly": {
          "useQuote": false,
          "isExpression": false,
          "value": false
        },
        "binding": {
          "type": "Form",
          "path": "auditStatus",
          "isExpression": false,
          "value": "auditStatus"
        },
        "dataField": "auditStatus",
        "dataType": "enum",
        "multiLanguage": false,
        "caption": "稽核状态",
        "draggable": false,
        "frozen": "none",
        "sortable": true,
        "resizeable": true,
        "enumData": [
          {
            "name": "未稽核",
            "value": "None"
          },
          {
            "name": "稽核通过",
            "value": "Passed"
          },
          {
            "name": "稽核不通过",
            "value": "Reject"
          }
        ],
        "aggregate": {
          "type": "none",
          "formatter": {
            "type": "none"
          }
        },
        "groupAggregate": {
          "type": "none",
          "formatter": {
            "type": "none"
          }
        },
        "linkedLabelEnabled": false,
        "updateOn": "change",
        "formatter": {
          "type": "none"
        }
      }
    ],
    "multiSelect": false,
    "showLineNumber": false,
    "lineNumberTitle": "#",
    "groupTotalText": "Total",
    "filterable": false,
    "groupable": false,
    "rowClass": ""
  }
};
    @NgCommand({
        name: 'ChangePage1',
        params: {
            loadCommandName: 'Filter1',
            loadCommandFrameId: 'root-component'
        },
        paramDescriptions: {
            loadCommandName: { type: 'string' },
            loadCommandFrameId: { type: 'string' }
        }
    })
    public ChangePage1(commandParam?: any): Observable<any> { return; }

    @NgCommand({
        name: 'datagridcomponentviewmodelView1',
        params: {
            url: '0215d45b-e684-4405-b2d2-b0cdc884cf6f',
            params: '{"action":"LoadAndView1", "id":"{DATA~/data-grid-component/id}"}',
            idToView: '',
            enableRefresh: '',
            tabName: '',
            destructuring: ''
        },
        paramDescriptions: {
            url: { type: 'string' },
            params: { type: 'string' },
            idToView: { type: 'string' },
            enableRefresh: { type: 'string' },
            tabName: { type: 'string' },
            destructuring: { type: 'string' }
        }
    })
    public datagridcomponentviewmodelView1(commandParam?: any): Observable<any> { return; }

}